package org.wu.framework.lazy.orm.database.sql.expand.database.persistence.event;

import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;

public abstract class AbstractLazyOrmEvent<T> implements LazyOrmEvent<T> {

    /**
     * 获取实体
     *
     * @return 实体
     */
    @Override
    public Class<T> payloadDataClass() {
        ParameterizedType parameterizedType = (ParameterizedType) this.getClass().getGenericSuperclass();
        final Type[] actualTypeArguments = parameterizedType.getActualTypeArguments();
        return (Class<T>) actualTypeArguments[0];
    }
}
